package com.yb.java.abstract_factory;

import com.yb.java.abstract_factory.color.Color;
import com.yb.java.abstract_factory.shape.Circle;
import com.yb.java.abstract_factory.shape.Rectangle;
import com.yb.java.abstract_factory.shape.Shape;
import com.yb.java.abstract_factory.shape.Square;

/**
 * @program: design-pattern
 * @description:
 * @author: Mr.Bo
 * @create: 2021-04-29 01:56
 **/
public class ShapeFactory extends AbstractFactory{
    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shape) {
        if(shape == null){
            return null;
        }
        if(shape.equalsIgnoreCase("CIRCLE")){
            return new Circle();
        } else if(shape.equalsIgnoreCase("RECTANGLE")){
            return new Rectangle();
        } else if(shape.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return null;
    }
}
